#ifndef CPolygone_H_
#define CPolygone_H_

#include <windows.h>
#include <iostream>

#include <list>

#include "CLine.h"


class CPolygone
{
public :
	CPolygone(){isClean = true ; } ;

private :

	// Points of the Polygone
	POINT begin     ;
	POINT lastpoint ;
	POINT center    ;

	bool isClean ;

	long totalx , totaly ;
	int nCorner ;

public :

	// List of lines and points 
	list<CLine> listline  ;
	list<POINT> listpoint ;

	list<CLine>::iterator iterline;
	
	// Check if the Polygone is cmplete ( end = begin )
	bool isComplete(){ return ( begin.x == lastpoint.x && begin.y == lastpoint.y && listline.empty() == false ) ; } ;
	
	void MakeCorner  ()       ;
	void AddPoint   (POINT p) ;
	void PlacePoints(long d)  ;
	
	void Draw(HDC hdc);
	
	void clear();


};


#endif
